<template>
  <div id="app">
    <KTable :data="tableData">
      <KTableColumn prop="date" label="日期1" sortable></KTableColumn>
      <KTableColumn prop="name" label="姓名"></KTableColumn>
      <KTableColumn prop="address" label="地址"></KTableColumn>
      <KTableColumn
          prop="op"
          label="操作"
          width="120">
        <template v-slot:default="scope">{{ scope.row.operation }}</template>
      </KTableColumn>

    </KTable>
  </div>
</template>

<script>

import KTable from "./KTable"
import KTableColumn from "./KTableColumn"
import  '../../icons'

console.log(KTableColumn)

export default {
  components: {KTable, KTableColumn},
  data() {
    const tableData = [
      {date: '2016-05-03', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄', operation: '添加'},
      {date: '2016-05-02', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄', operation: '删除'},
      {date: '2016-05-04', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄', operation: '修改'},
      {date: '2016-05-01', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄', operation: '添加'},
      {date: '2016-05-08', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄', operation: '删除'},
      {date: '2016-05-06', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄', operation: '修改'},
      {date: '2016-05-07', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄', operation: '添加'}
      ]

    const scope = {
      row: [1, 2, 3, 4, 5]
    }
    return {tableData, scope, }
  },
}
</script>
